package com.tmp.util;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;


public class Config {

	private static Configuration cfg = null;
	private static String configfile = "config.properties";
	static {
		try {
			cfg = new PropertiesConfiguration(configfile);
		} catch (ConfigurationException e) {
			e.printStackTrace();
		}
	}

	public static String getString(String key) {
		return cfg.getString(key);
	}

	public static String[] getStringArray(String key) {
		return cfg.getStringArray(key);
	}

	public static int getInt(String key) {
		return cfg.getInt(key);
	}
	
	public static void main(String[] args) {
		String serverurl = Config.getString("datasource.url");
		System.out.println(serverurl);
	}
}